import http from "@/utils/http/hub";

/**
 * 领券中心
 * cityCode:城市code
 */
export const couponCenter = (params, config) => {
  return http.post({
    url: `/couponCenter/index`,
    params,
    config,
  });
};

/**
 * 领券
 * couponId
 */
export const getCoupon = (params, config) => {
  return http.post({
    url: `/couponCenter/getCoupon`,
    params,
    config,
  });
};

/**
 * 我的优惠券
 * status
 * page
 * limit
 */
export const getMyCouponList = (params, config) => {
  return http.post({
    url: `/user/myCoupon`,
    params,
    config,
  });
};

/**
 * 服务收藏/取消收藏
 */
export const couponCollection = (params, config) => {
  return http.post({
    url: `/user/collectionOperation`,
    params,
    config,
  });
};

/**
 * 兑换CDK优惠券
 * cdkPassword 口令
 */
export const getCdkCoupon = (params, config) => {
  return http.post({
    url: `/couponCenter/getCdkCoupon`,
    params,
    config,
  });
};

/**
 * 活动:检测是否能领取优惠券包
 */
export const couponWeb = (
  params,
  config = {
    custom: {
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/couponCenter/couponWeb`,
    params,
    config,
  });
};

/**
 * 活动:领取优惠券包
 */
export const getCdkCouponActivity = (
  params,
  config = {
    custom: {
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/couponCenter/getCdkCoupon`,
    params,
    config,
  });
};
